﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NC.Infrastructure.Domain.Identity;

namespace NC.Service
{
    public class EnumDictionary
    {
        #region PeronRoleEnum
        /// <summary>
        /// 用户字典
        /// </summary>
        private static Dictionary<int, string> _roleDictionary;
        public static Dictionary<int, string> RoleDictionary
        {

            get
            {
                if (_roleDictionary == null)
                {
                    _roleDictionary = new Dictionary<int, string>();
                    _roleDictionary.Add((int)RoleEnum.Administrator, "管理员");
                    _roleDictionary.Add((int)RoleEnum.Customer, "普通会员");
                    _roleDictionary.Add((int)RoleEnum.Vip, "VIP会员");
                    _roleDictionary.Add((int)RoleEnum.Visitor, "游客");
                }
                return _roleDictionary;
            }
        }

        public static Dictionary<int, string> RoleDictionaryAll
        {
            get
            {
                var dic = RoleDictionary;
                if(!dic.ContainsKey(-1))
                    dic.Add(-1, "全部");
                return dic;
            }
        }

        #endregion

        #region InSchoolTime

        public static Dictionary<string, string> GetInSchoolTime
        {
            get
            {
                Dictionary<string,string> times=new Dictionary<string, string>();
                DateTime now = DateTime.Now;
                for (int i = now.Year-5; i <= now.Year; i++)
                {
                    times.Add(i.ToString(),i.ToString()+"年份");
                }
                return times;
            }
        }

        #endregion

        #region Audit
        /// <summary>
        /// 审核字典
        /// </summary>
        private static Dictionary<string, string> _auditDictionary;
        public static Dictionary<string, string> AuditDictionaryAll
        {
            get
            {
                var dic = AuditDictionary;
                if(!dic.ContainsKey("-1"))
                    dic.Add("-1", "全部");
                return dic;
            }
        }

        public static Dictionary<string, string> AuditDictionary
        {
            get
            {
                if (_auditDictionary == null)
                {
                    _auditDictionary = new Dictionary<string, string>();
                    _auditDictionary.Add("0", "未审核");
                    _auditDictionary.Add("1", "已审核");
                }
                return _auditDictionary;
            }
        }

        #endregion
    }
}
